#pragma once
#include "../esflow/vector.h"
#include "SingerCover.h"


const int g_nPlayTime      = 150;
const float g_Interval     = 1.5;
const float g_IntervalCover = 1.5;
const float g_fAngle       = 45;
const float g_CenterZ      = .5;



class CSingerAnimationCtrl
{
public:
    CSingerAnimationCtrl(void);
    ~CSingerAnimationCtrl(void);

    void StartAnimation(int nDirection);

    void Render(void);

    void Update();

    void StopAnimation();

    void DrawCenterCover(float factor);

    void DrawSlideCover(int Index, float factor);

    void DrawSlidesCover(float factor);

    void SetCenterIndex(int nIndex);

    int  GetCenterIndx();

    void SetOpenGL(int nLeft, int nTop, int nWidth, int nHeight);

    void ResetData();

    void MouseTrace(int x);

    void MouseStart(int start);

    void MouseUp();

public:
    enum
    {
        RULER = 150,
        RENDERNUMS = 9
    };

protected:
    int       m_flag;
    int       m_CenterIndex;
    int       m_iCoverIndex;
    bool      m_bIsPlaying;
    float     m_fPosPerSeconds;
    float     m_dwStartTime;
    CVector   m_CoverPos;
    int       m_MouseTrace,
              m_MouseStart;
};
